/**
 */
package gatperdut.chato.model.Chato.Item.impl;

import gatperdut.chato.model.Chato.Item.Drink;
import gatperdut.chato.model.Chato.Item.Food;
import gatperdut.chato.model.Chato.Item.GenericItem;
import gatperdut.chato.model.Chato.Item.ItemPackage;
import gatperdut.chato.model.Chato.Item.Stack;
import gatperdut.chato.model.Chato.Item.Wear;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.internal.cdo.CDOObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Generic Item</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericItemImpl#getShortDesc <em>Short Desc</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericItemImpl#getLongDesc <em>Long Desc</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericItemImpl#getFullDesc <em>Full Desc</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericItemImpl#getKeywords <em>Keywords</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericItemImpl#getStack <em>Stack</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericItemImpl#getFood <em>Food</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericItemImpl#getDrink <em>Drink</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericItemImpl#getW <em>W</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.GenericItemImpl#getWear <em>Wear</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class GenericItemImpl extends CDOObjectImpl implements GenericItem {
    /**
     * The default value of the '{@link #getShortDesc() <em>Short Desc</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getShortDesc()
     * @generated
     * @ordered
     */
    protected static final String SHORT_DESC_EDEFAULT = null;

    /**
     * The default value of the '{@link #getLongDesc() <em>Long Desc</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getLongDesc()
     * @generated
     * @ordered
     */
    protected static final String LONG_DESC_EDEFAULT = null;

    /**
     * The default value of the '{@link #getFullDesc() <em>Full Desc</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getFullDesc()
     * @generated
     * @ordered
     */
    protected static final String FULL_DESC_EDEFAULT = null;

    /**
     * The default value of the '{@link #getW() <em>W</em>}' attribute.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getW()
     * @generated
     * @ordered
     */
    protected static final int W_EDEFAULT = 0;

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected GenericItemImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return ItemPackage.Literals.GENERIC_ITEM;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected int eStaticFeatureCount() {
        return 0;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getShortDesc() {
        return (String)eDynamicGet(ItemPackage.GENERIC_ITEM__SHORT_DESC, ItemPackage.Literals.GENERIC_ITEM__SHORT_DESC, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setShortDesc(String newShortDesc) {
        eDynamicSet(ItemPackage.GENERIC_ITEM__SHORT_DESC, ItemPackage.Literals.GENERIC_ITEM__SHORT_DESC, newShortDesc);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getLongDesc() {
        return (String)eDynamicGet(ItemPackage.GENERIC_ITEM__LONG_DESC, ItemPackage.Literals.GENERIC_ITEM__LONG_DESC, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setLongDesc(String newLongDesc) {
        eDynamicSet(ItemPackage.GENERIC_ITEM__LONG_DESC, ItemPackage.Literals.GENERIC_ITEM__LONG_DESC, newLongDesc);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public String getFullDesc() {
        return (String)eDynamicGet(ItemPackage.GENERIC_ITEM__FULL_DESC, ItemPackage.Literals.GENERIC_ITEM__FULL_DESC, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setFullDesc(String newFullDesc) {
        eDynamicSet(ItemPackage.GENERIC_ITEM__FULL_DESC, ItemPackage.Literals.GENERIC_ITEM__FULL_DESC, newFullDesc);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @SuppressWarnings("unchecked")
    public EList<String> getKeywords() {
        return (EList<String>)eDynamicGet(ItemPackage.GENERIC_ITEM__KEYWORDS, ItemPackage.Literals.GENERIC_ITEM__KEYWORDS, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public Stack getStack() {
        return (Stack)eDynamicGet(ItemPackage.GENERIC_ITEM__STACK, ItemPackage.Literals.GENERIC_ITEM__STACK, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetStack(Stack newStack, NotificationChain msgs) {
        msgs = eDynamicInverseAdd((InternalEObject)newStack, ItemPackage.GENERIC_ITEM__STACK, msgs);
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setStack(Stack newStack) {
        eDynamicSet(ItemPackage.GENERIC_ITEM__STACK, ItemPackage.Literals.GENERIC_ITEM__STACK, newStack);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public Food getFood() {
        return (Food)eDynamicGet(ItemPackage.GENERIC_ITEM__FOOD, ItemPackage.Literals.GENERIC_ITEM__FOOD, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetFood(Food newFood, NotificationChain msgs) {
        msgs = eDynamicInverseAdd((InternalEObject)newFood, ItemPackage.GENERIC_ITEM__FOOD, msgs);
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setFood(Food newFood) {
        eDynamicSet(ItemPackage.GENERIC_ITEM__FOOD, ItemPackage.Literals.GENERIC_ITEM__FOOD, newFood);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public Drink getDrink() {
        return (Drink)eDynamicGet(ItemPackage.GENERIC_ITEM__DRINK, ItemPackage.Literals.GENERIC_ITEM__DRINK, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetDrink(Drink newDrink, NotificationChain msgs) {
        msgs = eDynamicInverseAdd((InternalEObject)newDrink, ItemPackage.GENERIC_ITEM__DRINK, msgs);
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setDrink(Drink newDrink) {
        eDynamicSet(ItemPackage.GENERIC_ITEM__DRINK, ItemPackage.Literals.GENERIC_ITEM__DRINK, newDrink);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public int getW() {
        return (Integer)eDynamicGet(ItemPackage.GENERIC_ITEM__W, ItemPackage.Literals.GENERIC_ITEM__W, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setW(int newW) {
        eDynamicSet(ItemPackage.GENERIC_ITEM__W, ItemPackage.Literals.GENERIC_ITEM__W, newW);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public Wear getWear() {
        return (Wear)eDynamicGet(ItemPackage.GENERIC_ITEM__WEAR, ItemPackage.Literals.GENERIC_ITEM__WEAR, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetWear(Wear newWear, NotificationChain msgs) {
        msgs = eDynamicInverseAdd((InternalEObject)newWear, ItemPackage.GENERIC_ITEM__WEAR, msgs);
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setWear(Wear newWear) {
        eDynamicSet(ItemPackage.GENERIC_ITEM__WEAR, ItemPackage.Literals.GENERIC_ITEM__WEAR, newWear);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case ItemPackage.GENERIC_ITEM__STACK:
                return basicSetStack(null, msgs);
            case ItemPackage.GENERIC_ITEM__FOOD:
                return basicSetFood(null, msgs);
            case ItemPackage.GENERIC_ITEM__DRINK:
                return basicSetDrink(null, msgs);
            case ItemPackage.GENERIC_ITEM__WEAR:
                return basicSetWear(null, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case ItemPackage.GENERIC_ITEM__SHORT_DESC:
                return getShortDesc();
            case ItemPackage.GENERIC_ITEM__LONG_DESC:
                return getLongDesc();
            case ItemPackage.GENERIC_ITEM__FULL_DESC:
                return getFullDesc();
            case ItemPackage.GENERIC_ITEM__KEYWORDS:
                return getKeywords();
            case ItemPackage.GENERIC_ITEM__STACK:
                return getStack();
            case ItemPackage.GENERIC_ITEM__FOOD:
                return getFood();
            case ItemPackage.GENERIC_ITEM__DRINK:
                return getDrink();
            case ItemPackage.GENERIC_ITEM__W:
                return getW();
            case ItemPackage.GENERIC_ITEM__WEAR:
                return getWear();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @SuppressWarnings("unchecked")
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case ItemPackage.GENERIC_ITEM__SHORT_DESC:
                setShortDesc((String)newValue);
                return;
            case ItemPackage.GENERIC_ITEM__LONG_DESC:
                setLongDesc((String)newValue);
                return;
            case ItemPackage.GENERIC_ITEM__FULL_DESC:
                setFullDesc((String)newValue);
                return;
            case ItemPackage.GENERIC_ITEM__KEYWORDS:
                getKeywords().clear();
                getKeywords().addAll((Collection<? extends String>)newValue);
                return;
            case ItemPackage.GENERIC_ITEM__STACK:
                setStack((Stack)newValue);
                return;
            case ItemPackage.GENERIC_ITEM__FOOD:
                setFood((Food)newValue);
                return;
            case ItemPackage.GENERIC_ITEM__DRINK:
                setDrink((Drink)newValue);
                return;
            case ItemPackage.GENERIC_ITEM__W:
                setW((Integer)newValue);
                return;
            case ItemPackage.GENERIC_ITEM__WEAR:
                setWear((Wear)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case ItemPackage.GENERIC_ITEM__SHORT_DESC:
                setShortDesc(SHORT_DESC_EDEFAULT);
                return;
            case ItemPackage.GENERIC_ITEM__LONG_DESC:
                setLongDesc(LONG_DESC_EDEFAULT);
                return;
            case ItemPackage.GENERIC_ITEM__FULL_DESC:
                setFullDesc(FULL_DESC_EDEFAULT);
                return;
            case ItemPackage.GENERIC_ITEM__KEYWORDS:
                getKeywords().clear();
                return;
            case ItemPackage.GENERIC_ITEM__STACK:
                setStack((Stack)null);
                return;
            case ItemPackage.GENERIC_ITEM__FOOD:
                setFood((Food)null);
                return;
            case ItemPackage.GENERIC_ITEM__DRINK:
                setDrink((Drink)null);
                return;
            case ItemPackage.GENERIC_ITEM__W:
                setW(W_EDEFAULT);
                return;
            case ItemPackage.GENERIC_ITEM__WEAR:
                setWear((Wear)null);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case ItemPackage.GENERIC_ITEM__SHORT_DESC:
                return SHORT_DESC_EDEFAULT == null ? getShortDesc() != null : !SHORT_DESC_EDEFAULT.equals(getShortDesc());
            case ItemPackage.GENERIC_ITEM__LONG_DESC:
                return LONG_DESC_EDEFAULT == null ? getLongDesc() != null : !LONG_DESC_EDEFAULT.equals(getLongDesc());
            case ItemPackage.GENERIC_ITEM__FULL_DESC:
                return FULL_DESC_EDEFAULT == null ? getFullDesc() != null : !FULL_DESC_EDEFAULT.equals(getFullDesc());
            case ItemPackage.GENERIC_ITEM__KEYWORDS:
                return !getKeywords().isEmpty();
            case ItemPackage.GENERIC_ITEM__STACK:
                return getStack() != null;
            case ItemPackage.GENERIC_ITEM__FOOD:
                return getFood() != null;
            case ItemPackage.GENERIC_ITEM__DRINK:
                return getDrink() != null;
            case ItemPackage.GENERIC_ITEM__W:
                return getW() != W_EDEFAULT;
            case ItemPackage.GENERIC_ITEM__WEAR:
                return getWear() != null;
        }
        return super.eIsSet(featureID);
    }

} //GenericItemImpl
